home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / tools / nwtp06 / loglock.pas < prev    next >
Pascal/Delphi Source File  |  1996-07-10  |  971b  |  40 lines

  1. {$X+,B-,V-} {essential compiler directives}
  2.  
  3. program loglock;
  4.  
  5. { Example for the nwServ unit / NwTP 0.6 API. (c) 1993,1995, R.Spronk }
  6.  
  7. { Purpose: This program toggles the login status..
  8.            If User Login was enabled, it will be diabled and v.v. }
  9.  
  10. { Tests the following nwServ functions:
  11.  
  12.   DisableFileServerLogin
  13.   EnableFileServerLogin
  14.   GetFileServerLoginStatus
  15. }
  16.  
  17. uses nwMisc,nwServ;
  18.  
  19. Var allowed:boolean;
  20.  
  21. begin
  22. IF GetFileServerLoginStatus(allowed)
  23.  then begin
  24.       if allowed
  25.        then begin
  26.             DisableFileServerLogin;
  27.             writeln('Login Disabled.')
  28.             end
  29.        else begin
  30.             EnableFileserverLogin;
  31.             writeln('Login Enabled.')
  32.             end
  33.       end
  34.  else begin
  35.       if nwServ.result=$C6
  36.        then writeln('You need console operator rights to run this utility.')
  37.        else writeln('GetFileserverLoginStatus Error : $',HexStr(nwServ.result,2));
  38.       end;
  39. end.
  40.